

emailLoginCheck = function (){
    var mail = $("#mail").val();
    var code = $("#code").val();

    var data ={
        "mail":mail,
        "code":code
    }

    $.ajax({
        url:"/loginCheckByMail",
        type:"Post",
        data:data,
        dataType:"html",
        success:function (data)
        {
            if(data.toString().length>=20)
            {
                window.localStorage.setItem("token",data);
                window.location.href="/index?token="+data;
            }
            else {
                alert(data);
            }
        }
    });

}


getCode =function ()
{
    var mail= $("#mail").val();
    var data={
        "mail":mail
    }
    $.ajax({
        url:"/GetEMailCode",
        type:"GET",
        data:data,
        success(data) {
            alert(data);
        }
    })
}